package com.hckj.jianzhijia.model;

import com.avos.avoscloud.AVFile;
import com.avos.avoscloud.AVObject;
import com.avos.avoscloud.AVUser;

/**
 * Created by 赵奇隆 on 2015-12-01.
 */
public class Identification {

    public static final String TABLE_NAME = "identification";
    public static final int TYPE_COMPANY = 1;
    public static final int TYPE_SCHOOL = 2;
    public static final int STATE_FAIL = 1;
    public static final int STATE_ING = 2;
    public static final int STATE_SUCCESS = 3;

    private AVObject identification;
    private AVUser user;
    private String contactPersonName;
    private String contactPhone;
    private int identificationType;
    private AVFile licensePic;
    private String licenseNum;
    private String IDCardNum;
    private AVFile peopleIDCard1;
    private AVFile peopleIDCard2;
    private int state ;
    private String failReason;


    public Identification() {
        this.identification = new AVObject(TABLE_NAME);

    }

    public Identification(AVObject identification) {
        this.identification = identification;
        this.user = identification.getAVUser("user");
        this.contactPersonName = identification.getString("contactPersonName");
        this.contactPhone = identification.getString("contactPhone");
        this.identificationType = identification.getInt("identificationType");
        this.licensePic = identification.getAVFile("licensePic");
        this.licenseNum = identification.getString("licenseNum");
        this.peopleIDCard1 = identification.getAVFile("peopleIDCard1");
        this.peopleIDCard2 = identification.getAVFile("peopleIDCard2");
        this.state = identification.getInt("state");
        this.failReason = identification.getString("failReason");
        this.IDCardNum = identification.getString("IDCardNum");
    }

    public String getContactPersonName() {
        return contactPersonName;
    }

    public void setContactPersonName(String contactPersonName) {
        this.contactPersonName = contactPersonName;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }

    public String getFailReason() {
        return failReason;
    }

    public void setFailReason(String failReason) {
        this.failReason = failReason;
    }

    public AVObject getIdentification() {

        this.identification.put("user",user);
        this.identification.put("contactPersonName",contactPersonName);
        this.identification.put("contactPhone",contactPhone);
        this.identification.put("identificationType",identificationType);
        this.identification.put("licensePic",licensePic);
        this.identification.put("licenseNum",licenseNum);
        this.identification.put("peopleIDCard1",peopleIDCard1);
        this.identification.put("peopleIDCard2",peopleIDCard2);
        this.identification.put("state",state);
        this.identification.put("failReason",failReason);
        this.identification.put("IDCardNum",IDCardNum);

        return identification;
    }

    public void setIdentification(AVObject identification) {
        this.identification = identification;
    }

    public int getIdentificationType() {
        return identificationType;
    }

    public void setIdentificationType(int identificationType) {
        this.identificationType = identificationType;
    }

    public AVFile getLicensePic() {
        return licensePic;
    }

    public void setLicensePic(AVFile licensePic) {
        this.licensePic = licensePic;
    }

    public AVFile getPeopleIDCard1() {
        return peopleIDCard1;
    }

    public void setPeopleIDCard1(AVFile peopleIDCard1) {
        this.peopleIDCard1 = peopleIDCard1;
    }

    public String getLicenseNum() {
        return licenseNum;
    }

    public void setLicenseNum(String licenseNum) {
        this.licenseNum = licenseNum;
    }

    public AVFile getPeopleIDCard2() {
        return peopleIDCard2;
    }

    public void setPeopleIDCard2(AVFile peopleIDCard2) {
        this.peopleIDCard2 = peopleIDCard2;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public AVUser getUser() {
        return user;
    }

    public void setUser(AVUser user) {
        this.user = user;
    }

    public String getIDCardNum() {
        return IDCardNum;
    }

    public void setIDCardNum(String IDCardNum) {
        this.IDCardNum = IDCardNum;
    }
}
